* make regressions of other value measures on female shares of supply 

*first, get the supply measure from Bookstat 
cd "D:\Dropbox\book_welfare\replication\"



use data\bookstat_gender_pyear_genre_asin.dta, clear 
 	keep if pyear>=1960 & pyear<=2021 		
	collapse (sum) males=N_male name_present=N_name total, by(pyear)

		
		
 * of those with identification
	gen rv_in =  1 - males/name_present 	
				

* known women over total (conservative )
	gen rv_all = (name_present - males)/total 


		

	label var rv_all "\% fem-aut'd"
	label var rv_in "\% fem-aut'd of id'd"

	rename pyear year 
	keep year rv_all rv_in
	tempfile bs 
	save `bs'


*********************
* LOC
*********************



use data\loc_summary.dta, clear 
	gen x=1
	* table x, c(sum N sum Nname sum Nmatch sum Nfemale)

	collapse (sum) N Nmatch Nfemale fem_share, by(year subject)
	rename subject category
	 
	 
	gen sv_all = Nfemale/N 
	gen sv_in = Nfemale/Nmatch 
	
	merge m:1 year using `bs'
	
	egen catno=group(category)
	
	label var sv_all "LOC \%fem"
	label var sv_in "LOC \%fem id'd"
	
	
eststo clear

eststo:	reg sv_all i.catno rv_all



***********
* pulitzer
***********

	 use  "data\pulitzer.dta", clear 
		gen x=1
	* table x if year>=1960, c(sum N sum Nmatch sum Nfemale)
 
	
		gen sv_all = Nfemale/N 
		gen sv_in = Nfemale/Nmatch 
		
		merge m:1 year using `bs'

		egen catno=group(category)


		label var sv_all "Pulitzer \%fem"
		label var sv_in "Pulitzer \%fem id'd"

		eststo: reg sv_all i.catno rv_all 


****************
* nat book award 
****************


 use  data\nba.dta, clear 
		gen x=1

		gen sv_all = Nf/N 
		gen sv_in = Nf/Nname 
		merge m:1 year using `bs'

		egen catno=group(category)

		label var sv_all "NBA \%fem"
		label var sv_in "NBA \%fem id'd"


		eststo: reg sv_all i.catno rv_all 

**********************
* bestsellers 
**********************	
	
use  data\bestsellers.dta, clear 
		gen x=1
		gen nyt_f = nyt_name - nyt_m 

		gen s_nyt = (nyt_name - nyt_m)/nyt_total 
		gen s_pw = (pw_name - pw_m)/pw_total 
		gen s_usat = (usat_name - usat_m)/usat_total 
			merge m:1 year using `bs'

		label var s_nyt "NYT"
		label var s_pw "PW top 10"
		label var s_usat "USAT"

		eststo: reg s_nyt  rv_all

 
 
 
local pattern prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span})
	esttab,  noomitted mtitles("LOC \%fem" "Pul \%fem"  "NBA \%fem" "NYT \%fem" )  keep(rv_all ) se replace  label nonotes star(* 0.10 ** 0.05 *** 0.01) scalars("r2_a $\overline{R^2}$") nocons
	
	esttab using "latex_text\tables\awards_regression.tex",  noomitted mtitles("LOC \%fem" "Pul \%fem"  "NBA \%fem" "NYT \%fem" )   keep(rv_all) se replace  label nonotes star(* 0.10 ** 0.05 *** 0.01) scalars("r2_a $\overline{R^2}$") nocons booktabs
	
	
